
import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;


/**
 * GarageDoor Test for the Closed State
 * 
 * Created on:
 * 05.12.2006
 * 11:24:50
 * 
 * @author alaak
 * 
 * Modified
 * 17.01.08
 * 11:00:00
 * 
 * 31.01.08
 * 15:36
 * 
 * @author koschka
 */

public class GaragentorGeschlossenTest extends BasicTest {
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		super.setUp();
	}

	/**
	 * Test method for {@link Garagentor#tasteZu()}.
	 */
	@Test
	public void testPressingCloseDoor() {
		gd.closeDoor();
		
		assertEquals("While pressing the closeDoor key in closed state the door should remain closed!",
				(gd.new Closed()).getClass(), getState().getClass());

		
		// old stuff
		//assertEquals(
		//		"While pressing ZU in closed state the motor should be off!",
		//		(motor.new Aus()).getClass(), (gt.holeMotor().aktuellerZustand()).getClass());

	}

	/**
	 * Test method for {@link Garagentor#tasteAuf()}.
	 */
	
	@Test
	public void testPressingOpenDoor() {
		gd.openDoor();
		
		assertEquals("While pressing AUF in closed state the gate should open!",
				gd.new Opening().getClass(), getState().getClass());
		
		// old stuff
		//assertEquals(
		//		"While pressing AUF in closed state the motor should rotate upwards!",
		//		motor.new Aufwaerts().getClass(), gt.holeMotor()
		//				.aktuellerZustand().getClass());
	}

	/**
	 * Test method for {@link Garagentor#anschlag()}.
	 */
	@Test
	public void testStopper() {
		gd.stopper();
		
		
		assertEquals("Getting the endsignal in closed state the gate should remain closed!",
				gd.new Closed().getClass(), getState().getClass());
		
		// old stuff
		//assertEquals("Getting the endsignal the motor should be off!",
		//		motor.new Aus().getClass(), gt.holeMotor().aktuellerZustand()
		//				.getClass());
	}
}
